﻿using Dting;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace FormsData
{
    public class Main_logicClass
    {
        //设备数量
        public int equipment_Number { set; get; }

        //声明LOG
        //public logs _Logs { set; get; } = null;

        private bool Task_state = false;
        private Thread task_class;
        public Main_logicClass()
        {
            //start_task();
        }
        public void Main_logicClass_Dispose()
        {
            //close_task();
        }


        public void start_task()
        {
            task_class = new Thread(new ThreadStart(task_work));
            task_class.IsBackground = false;
            task_class.Start();
            Task_state = true;
        }

        public void close_task()
        {

            Task_state = false;
            try { if (task_class.IsAlive) task_class.Abort(); } catch {; }
            task_class.Join();
        }


        private void task_work()
        {
            while(Task_state)
            {
                try
                {


                    Thread.Sleep(50);
                }
                catch (Exception er)
                {
                    ;
                }
            }
        }

    }
}
